//
//  ZXLGoodsDetailController.m
//  EPA
//
//  Created by 朱兴隆 on 16/4/22.
//  Copyright © 2016年 朱兴隆. All rights reserved.
//

#import "ZXLGoodsDetailController.h"

@interface ZXLGoodsDetailController ()<UIWebViewDelegate>
@property (nonatomic, strong) UIWebView *webView;
@end

@implementation ZXLGoodsDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
    NSURL *url = [NSURL URLWithString:self.buyurl];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.webView loadRequest:request];
    
    self.webView.delegate = self;
    
    [self.view addSubview:self.webView];
    
    
    
}
// 设置字体大小
- (void)webViewDidFinishLoad:(UIWebView *)webView {

    [self.webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='200%'"];
    
    NSString *meta = [NSString stringWithFormat:@"document.getElementsByName(\"viewport\")[0].content = \"width=self.view.frame.size.width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no\""];
    [self.webView stringByEvaluatingJavaScriptFromString:meta];
}

// 设置webView内容宽度等于屏幕宽度显示,设置webView的缩放效果




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
